<table id="cart_products">
    <thead>
        <tr>
            <th colspan="2"><span th:text="#{cart.item}">Item</span></th>
            <th><span th:text="#{cart.quantity}">Quantity</span></th>
            <th> <span th:text="#{cart.price}">Price</span> <span class="small" th:text="#{cart.each}">(each)</span></th>
            <th> <span th:text="#{cart.totalSavings}">Total Savings</span></th>
            <th><span th:text="#{cart.total}">Total</span></th>
        </tr>
    </thead>
    <tbody>
        <tr th:each="item : ${cart.orderItems}" th:object="${item}" th:id="${'productRow' + item.id}">
            <td><img th:if="*{product.media['primary']}" th:src="@{*{product.media['primary'].url} + '?thumbnail'}" width="60" th:alt="*{product.name}" /></td>
            <td class="name">
                <a th:href="@{*{product.url}}" th:text="*{product.name}"></a>
                <br/>
               <blc:product_option_display orderItem="${item}" >
                     <ul th:unless="${#lists.isEmpty(productOptionDisplayValues)}" class="productOptions">
                         <li th:each="entry: ${productOptionDisplayValues}">
                           <span  th:text="${entry.key} + ': ' + ${entry.value}"></span>
                         </li>
                     </ul>
                </blc:product_option_display> 
                <ul th:if="${item instanceof T(org.broadleafcommerce.core.order.domain.BundleOrderItem)}">
                    <li th:each="doi : *{discreteOrderItems}" th:text="${doi.quantity + ' x ' + doi.name}" />
                </ul>
            </td>
            <td align="center">
                <blc:form method="POST" th:action="@{/cart/updateQuantity}">
                    <input type="hidden" name="productId" th:value="*{product.id}" />
                    <input type="hidden" name="orderItemId" th:value="*{id}" />
                    <input type="number" name="quantity" class="quantityInput" style="width:30px" th:value="*{quantity}" maxlength="3" autocomplete="off"/><br />
                    <input type="submit" class="updateQuantity" th:value="#{cart.update}"/>
                </blc:form>
                <a class="cartLinkBtn remove_from_cart" th:href="@{/cart/remove(orderItemId=*{id}, productId=*{product.id})}"><span th:text="#{cart.remove}">Remove</span></a>
            </td>
            <td align="center" blc:price="*{getPriceBeforeAdjustments(true)}"></td>
            
            <td align="center" th:if="*{adjustmentValue.zero}">---</td>
            <td align="center" class="discount" th:unless="*{adjustmentValue.zero}" >
            <span  blc:price="*{totalAdjustmentValue}" ></span>
                 <div class="productOptions" th:substituteby="catalog/partials/offers :: offers"/>
             </td>
            <td th:if="!${item instanceof T(org.broadleafcommerce.core.order.domain.BundleOrderItem)}" align="center" class="value" blc:price="*{totalPrice}"></td>
            <td th:if="${item instanceof T(org.broadleafcommerce.core.order.domain.BundleOrderItem)}" align="center" class="value" blc:price="*{totalPrice}"></td>
        </tr>
    </tbody>
</table>
